<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>pciepsu: xpciepsu_ep.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">pciepsu
   </div>
   <div id="projectbrief">Vitis Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Overview</span></a></li>
      <li><a href="globals.html"><span>APIs</span></a></li>
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="pages.html"><span>Examples</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('xpciepsu__ep_8c.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">xpciepsu_ep.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p>Implements all of functions for psu_pci IP EndPoint driver. </p>
<pre>
MODIFICATION HISTORY:</pre><pre>Ver   Who  Date     Changes
</p>
<hr/>
<p>
1.0     tk      02/13/2019      First release
</pre> </div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a242ba36cd7d2aa4f33863bc5aa8075d8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xpciepsu__ep_8c.html#a242ba36cd7d2aa4f33863bc5aa8075d8">XPciePsu_EP_CfgInitialize</a> (XPciePsu *PciePsuPtr, const XPciePsu_Config *ConfigPtr)</td></tr>
<tr class="memdesc:a242ba36cd7d2aa4f33863bc5aa8075d8"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function initializes the config space.  <a href="#a242ba36cd7d2aa4f33863bc5aa8075d8">More...</a><br/></td></tr>
<tr class="separator:a242ba36cd7d2aa4f33863bc5aa8075d8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a99474c575ca291a93548797b66df45b8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xpciepsu__ep_8c.html#a99474c575ca291a93548797b66df45b8">XPciePsu_EP_BridgeInitialize</a> (XPciePsu *PciePsuPtr)</td></tr>
<tr class="memdesc:a99474c575ca291a93548797b66df45b8"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function initializes PCIe bridge.  <a href="#a99474c575ca291a93548797b66df45b8">More...</a><br/></td></tr>
<tr class="separator:a99474c575ca291a93548797b66df45b8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6486e8d86d93762e998010aa29efd100"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xpciepsu__ep_8c.html#a6486e8d86d93762e998010aa29efd100">XPciePsu_Egress_EP_BridgeInitialize</a> (XPciePsu *PciePsuPtr)</td></tr>
<tr class="memdesc:a6486e8d86d93762e998010aa29efd100"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function initializes Egress PCIe bridge.  <a href="#a6486e8d86d93762e998010aa29efd100">More...</a><br/></td></tr>
<tr class="separator:a6486e8d86d93762e998010aa29efd100"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aca1b71a1574b91939ee539c11556ce88"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xpciepsu__ep_8c.html#aca1b71a1574b91939ee539c11556ce88">XPciePsu_EP_WaitForLinkup</a> (XPciePsu *PciePsuPtr)</td></tr>
<tr class="memdesc:aca1b71a1574b91939ee539c11556ce88"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function waits for Pcie link to come up.  <a href="#aca1b71a1574b91939ee539c11556ce88">More...</a><br/></td></tr>
<tr class="separator:aca1b71a1574b91939ee539c11556ce88"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1d40296b15e59da3006fda5faa6a5d9c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xpciepsu__ep_8c.html#a1d40296b15e59da3006fda5faa6a5d9c">XPciePsu_EP_WaitForEnumeration</a> (XPciePsu *PciePsuPtr)</td></tr>
<tr class="memdesc:a1d40296b15e59da3006fda5faa6a5d9c"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function waits for host to enumerate.  <a href="#a1d40296b15e59da3006fda5faa6a5d9c">More...</a><br/></td></tr>
<tr class="separator:a1d40296b15e59da3006fda5faa6a5d9c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af44c30122a4a391b9c486f9646e7cf2e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xpciepsu__ep_8c.html#af44c30122a4a391b9c486f9646e7cf2e">Do_Egress_Test</a> (u32 *egress_src_lo)</td></tr>
<tr class="memdesc:af44c30122a4a391b9c486f9646e7cf2e"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function does Egress test.  <a href="#af44c30122a4a391b9c486f9646e7cf2e">More...</a><br/></td></tr>
<tr class="separator:af44c30122a4a391b9c486f9646e7cf2e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a60670dca0dbddb37079e9917e41eae40"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xpciepsu__ep_8c.html#a60670dca0dbddb37079e9917e41eae40">XPciePsu_EP_SetupIngress</a> (XPciePsu *PciePsuPtr, u32 IngressNum, u32 BarNum, u64 Dst)</td></tr>
<tr class="memdesc:a60670dca0dbddb37079e9917e41eae40"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function sets up ingress translation.  <a href="#a60670dca0dbddb37079e9917e41eae40">More...</a><br/></td></tr>
<tr class="separator:a60670dca0dbddb37079e9917e41eae40"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac7e335a61b13a5455ddaa43f46a416a4"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xpciepsu__ep_8c.html#ac7e335a61b13a5455ddaa43f46a416a4">XPciePsu_EP_SetupEgress</a> (XPciePsu *PciePsuPtr, u32 EgressNum)</td></tr>
<tr class="memdesc:ac7e335a61b13a5455ddaa43f46a416a4"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function sets up Egress translation.  <a href="#ac7e335a61b13a5455ddaa43f46a416a4">More...</a><br/></td></tr>
<tr class="separator:ac7e335a61b13a5455ddaa43f46a416a4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="af44c30122a4a391b9c486f9646e7cf2e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Do_Egress_Test </td>
          <td>(</td>
          <td class="paramtype">u32 *&#160;</td>
          <td class="paramname"><em>egress_src_lo</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function does Egress test. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">egress</td><td>source address </td></tr>
  </table>
  </dd>
</dl>

<p>Referenced by <a class="el" href="xpciepsu__ep_8h.html#ad0ab59afa2bae270a5be2f4496945dde">XPciePsu_EP_SetupEgress()</a>.</p>

</div>
</div>
<a class="anchor" id="a6486e8d86d93762e998010aa29efd100"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XPciePsu_Egress_EP_BridgeInitialize </td>
          <td>(</td>
          <td class="paramtype">XPciePsu *&#160;</td>
          <td class="paramname"><em>PciePsuPtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function initializes Egress PCIe bridge. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">PciePsuPtr</td><td>pointer to XPciePsu Instance Pointer </td></tr>
  </table>
  </dd>
</dl>

<p>References <a class="el" href="xpciepsu_8c.html#a0cfd7833187346f6f654d80a359951b0">XPciePsu_ReadReg()</a>, and <a class="el" href="xpciepsu_8c.html#a558622766b2c01af123a216c1d682376">XPciePsu_WriteReg()</a>.</p>

<p>Referenced by <a class="el" href="xpciepsu__egress__ep__enable__example_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main()</a>.</p>

</div>
</div>
<a class="anchor" id="a99474c575ca291a93548797b66df45b8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XPciePsu_EP_BridgeInitialize </td>
          <td>(</td>
          <td class="paramtype">XPciePsu *&#160;</td>
          <td class="paramname"><em>PciePsuPtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function initializes PCIe bridge. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">PciePsuPtr</td><td>pointer to XPciePsu Instance Pointer </td></tr>
  </table>
  </dd>
</dl>

<p>References <a class="el" href="xpciepsu_8c.html#a0cfd7833187346f6f654d80a359951b0">XPciePsu_ReadReg()</a>, and <a class="el" href="xpciepsu_8c.html#a558622766b2c01af123a216c1d682376">XPciePsu_WriteReg()</a>.</p>

</div>
</div>
<a class="anchor" id="a242ba36cd7d2aa4f33863bc5aa8075d8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XPciePsu_EP_CfgInitialize </td>
          <td>(</td>
          <td class="paramtype">XPciePsu *&#160;</td>
          <td class="paramname"><em>PciePsuPtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const XPciePsu_Config *&#160;</td>
          <td class="paramname"><em>ConfigPtr</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function initializes the config space. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">PciePsuPtr</td><td>pointer to XPciePsu Instance Pointer </td></tr>
    <tr><td class="paramname">ConfigPtr</td><td>pointer to XPciePsu_Config instrance Pointer.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>XST_SUCCESS on success err on failure </dd></dl>

<p>Referenced by <a class="el" href="xpciepsu__egress__ep__enable__example_8c.html#a71de060d9b164f1bcc1a31f0dea4fe07">XPciePsu_InitEndPoint()</a>.</p>

</div>
</div>
<a class="anchor" id="ac7e335a61b13a5455ddaa43f46a416a4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XPciePsu_EP_SetupEgress </td>
          <td>(</td>
          <td class="paramtype">XPciePsu *&#160;</td>
          <td class="paramname"><em>PciePsuPtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>EgressNum</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function sets up Egress translation. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">PciePsuPtr</td><td>pointer to XPciePsu_Config Instance Pointer </td></tr>
    <tr><td class="paramname">EgressNum</td><td>ingress must be 0 to 7</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>XST_SUCCESS if setup is successful XST_FAILURE if setup is fail </dd></dl>

<p>References <a class="el" href="xpciepsu__ep_8c.html#af44c30122a4a391b9c486f9646e7cf2e">Do_Egress_Test()</a>, <a class="el" href="xpciepsu_8c.html#a0cfd7833187346f6f654d80a359951b0">XPciePsu_ReadReg()</a>, and <a class="el" href="xpciepsu_8c.html#a558622766b2c01af123a216c1d682376">XPciePsu_WriteReg()</a>.</p>

<p>Referenced by <a class="el" href="xpciepsu__egress__ep__enable__example_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main()</a>.</p>

</div>
</div>
<a class="anchor" id="a60670dca0dbddb37079e9917e41eae40"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int XPciePsu_EP_SetupIngress </td>
          <td>(</td>
          <td class="paramtype">XPciePsu *&#160;</td>
          <td class="paramname"><em>PciePsuPtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>IngressNum</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>BarNum</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u64&#160;</td>
          <td class="paramname"><em>Dst</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function sets up ingress translation. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">PciePsuPtr</td><td>pointer to XPciePsu_Config Instance Pointer </td></tr>
    <tr><td class="paramname">IngressNum</td><td>ingress must be 0 to 7 </td></tr>
    <tr><td class="paramname">BarNum</td><td>bar no to setup ingress </td></tr>
    <tr><td class="paramname">Dst</td><td>32 or 64 bit destination address</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>XST_SUCCESS if setup is successful XST_FAILURE if setup is fail </dd></dl>

<p>References <a class="el" href="xpciepsu_8c.html#a0cfd7833187346f6f654d80a359951b0">XPciePsu_ReadReg()</a>, and <a class="el" href="xpciepsu_8c.html#a558622766b2c01af123a216c1d682376">XPciePsu_WriteReg()</a>.</p>

</div>
</div>
<a class="anchor" id="a1d40296b15e59da3006fda5faa6a5d9c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XPciePsu_EP_WaitForEnumeration </td>
          <td>(</td>
          <td class="paramtype">XPciePsu *&#160;</td>
          <td class="paramname"><em>PciePsuPtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function waits for host to enumerate. </p>
<p>On x86 BIOS sets memory enable bit On ARM64 it is set when driver gets inserted</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">PciePsuPtr</td><td>pointer to XPciePsu_Config Instance Pointer </td></tr>
  </table>
  </dd>
</dl>

<p>References <a class="el" href="xpciepsu_8c.html#a0cfd7833187346f6f654d80a359951b0">XPciePsu_ReadReg()</a>.</p>

</div>
</div>
<a class="anchor" id="aca1b71a1574b91939ee539c11556ce88"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void XPciePsu_EP_WaitForLinkup </td>
          <td>(</td>
          <td class="paramtype">XPciePsu *&#160;</td>
          <td class="paramname"><em>PciePsuPtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function waits for Pcie link to come up. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">PciePsuPtr</td><td>pointer to XPciePsu_Config Instance Pointer </td></tr>
  </table>
  </dd>
</dl>

<p>References <a class="el" href="xpciepsu_8c.html#a0cfd7833187346f6f654d80a359951b0">XPciePsu_ReadReg()</a>.</p>

<p>Referenced by <a class="el" href="xpciepsu__egress__ep__enable__example_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
	<p class="footer">&copy; Copyright 2015-2022 Xilinx, Inc. All Rights Reserved.</p>
	<p class="footer">&copy; Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.</p>
</div>
</body>
</html>
